import store from "../store";
export default function init() {
    let config = JSON.parse(sessionStorage.getItem("configParams"));
    console.log("config", config);
    store.commit("setConfigParams", config);
    // let tpConfig = config.templateConfigList.filter(item => {
    //     return item.tpState === 1;
    // })[0].tpConfig;
    //默认启用的domTree
    console.log("config.templateConfigList", config.templateConfigList);
    let normalDomTree = JSON.parse(
        config.templateConfigList.find(item => {
            // if (item.tpState === 1) {
            // 	console.log("item", item);
            // }
            return item.tpState === 1;
        }).tpConfig
        // tpConfig
    );
    //再加上新增页面的domTree
    // console.log("normalDomTree", normalDomTree)
    // this.$store.commit("setDomTree", Object.assign(normalDomTree, this.specialDomTree));
    store.commit("setDomTree", normalDomTree);
    //sessionStorage功成身退
    sessionStorage.removeItem("configParams");
}